/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lenovo
 * Date: 2025-03-27
 * Time: 23:33
 */
// 鸭子：继承Animal，实现三种能力
class Duck extends Animal implements Runnable,Flyable,Swimmable {
    public Duck(String name) {
        super(name);
    }

    @Override
    public void fly() {
        System.out.println(getName() + "扑腾翅膀低空飞行");
    }

    @Override
    public void run() {
        System.out.println(getName() + "嘎嘎跑");
    }

    @Override
    public void swim() {
        System.out.println(getName() + "用脚蹼划水游泳");
    }

    @Override
    public void eat() {
        System.out.println(getName() + "吃饲料");
    }
}
